class ShopBean {
   int code;
   String msg;
   ShopDataBean data;

   Map<String,dynamic> toJson()=>jsonFromShopShopBean(this);
   ShopBean(Map<String,dynamic> json){
       jsonToShopShopBean(json,this);
   }
}
class ShopDataBean {
   int shopId;
   String shopName;
   String shopHead;
   String goodsNum;
   String mainCat;
   String address;
   String shopAddress;
   String signage;
   String intro;
   int isCollected;
   String marketName;
   int isNormal;
   ShopDataContactBean contact;

   Map<String,dynamic> toJson()=>jsonFromShopShopDataBean(this);
   ShopDataBean(Map<String,dynamic> json){
       jsonToShopShopDataBean(json,this);
   }
}
class ShopDataContactBean {
   List<String> phone;
   List<String> qq;
   List<String> wx;
   List<String> ww;

   Map<String,dynamic> toJson()=>jsonFromShopShopDataContactBean(this);
   ShopDataContactBean(Map<String,dynamic> json){
       jsonToShopShopDataContactBean(json,this);
   }
}

//-------------------------------解析方法---------------------------------

void jsonToShopShopBean(Map<String,dynamic> json,ShopBean bean){
   if(json==null) return;
   bean.code=int.parse(json["code"]?.toString()??"0");
   bean.msg=json["msg"]?.toString()??"";
   bean.data=ShopDataBean(json["data"]);
}
void jsonToShopShopDataBean(Map<String,dynamic> json,ShopDataBean bean){
   if(json==null) return;
   // bean.shopId=int.parse(json["shop_id"]?.toString()??"0");
   bean.shopName=json["shop_name"]?.toString()??"";
   bean.shopHead=json["shop_head"]?.toString()??"";
   bean.goodsNum=json["goods_num"]?.toString()??"";
   bean.mainCat=json["main_cat"]?.toString()??"";
   bean.address=json["address"]?.toString()??"";
   bean.shopAddress=json["shop_address"]?.toString()??"";
   bean.signage=json["signage"]?.toString()??"";
   bean.intro=json["intro"]?.toString()??"";
   bean.isCollected=int.parse(json["is_collected"]?.toString()??"0");
   bean.marketName=json["market_name"]?.toString()??"";
   bean.isNormal=int.parse(json["is_normal"]?.toString()??"0");
   bean.contact=ShopDataContactBean(json["contact"]);
}
void jsonToShopShopDataContactBean(Map<String,dynamic> json,ShopDataContactBean bean){
   if(json==null) return;
   bean.phone=[];
   for(var item in json["phone"]){
      bean.phone.add(item?.toString()??"");
   }
   bean.qq=[];
   for(var item in json["qq"]){
      bean.qq.add(item?.toString()??"");
   }
   bean.wx=[];
   for(var item in json["wx"]){
      bean.wx.add(item?.toString()??"");
   }
   bean.ww=[];
   for(var item in json["ww"]){
      bean.ww.add(item?.toString()??"");
   }
}

Map<String,dynamic> jsonFromShopShopBean(ShopBean bean)=>{
   "code":bean.code,
   "msg":bean.msg,
   "data":bean.data.toJson()
};

Map<String,dynamic> jsonFromShopShopDataBean(ShopDataBean bean)=>{
   "shop_id":bean.shopId,
   "shop_name":bean.shopName,
   "shop_head":bean.shopHead,
   "goods_num":bean.goodsNum,
   "main_cat":bean.mainCat,
   "address":bean.address,
   "shop_address":bean.shopAddress,
   "signage":bean.signage,
   "intro":bean.intro,
   "is_collected":bean.isCollected,
   "market_name":bean.marketName,
   "is_normal":bean.isNormal,
   "contact":bean.contact.toJson()
};

Map<String,dynamic> jsonFromShopShopDataContactBean(ShopDataContactBean bean)=>{
   "phone":bean.phone,
   "qq":bean.qq,
   "wx":bean.wx,
   "ww":bean.ww
};


